package com.zjuh.goodboy.biz.dataprovider;

import com.zjuh.goodboy.misc.DateRange;
import com.zjuh.goodboy.misc.DateRangeSupport;
import com.zjuh.goodboy.store.item.JdbcItemStore;
import com.zjuh.sweet.lang.DateUtil;

public class IncrItemDataProvider extends AbstractItemDataProvider implements DateRangeSupport {

	private DateRange dateRange;
	
	@Override
	protected String getSql() {
		String sql = "select id, " + JdbcItemStore.ITEM_FULL_FIELDS + " from goodboy_item_data where gmt_modified >= '"+
			DateUtil.formatFullDate(dateRange.getStart())
		+"' and gmt_modified <= '" + DateUtil.formatFullDate(dateRange.getEnd()) + "'";
		return sql;
	}

	@Override
	public void setDateRange(DateRange dateRange) {
		this.dateRange = dateRange;
	}

}
